Skip to content

fix(terraform-deploy): skip metric for blocked unsafe deployments - #260

Open
stekern wants to merge 1 commit into
mainfrom
fix/terraform-deploy-block-unsafe-deployment
Open

fix(terraform-deploy): skip metric for blocked unsafe deployments#260
stekern wants to merge 1 commit into
mainfrom
fix/terraform-deploy-block-unsafe-deployment

Conversation

@stekern

@stekern stekern commented May 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Do not publish metrics if a deployment of a non-trunk artifact to production has been blocked, as it is an expected failure
  • Improve testability of the deployment blocking behavior (e.g., by using inputs.tag instead of github.event.inputs.artifact-tag, as the latter is only set on workflow_dispatch), and a test for it

The non-trunk-to-prod safety check now runs regardless of trigger and
exposes a `__internal-block-unsafe-deployment-result` output so the
deployment metric step can skip when the deploy was refused by policy
(an expected rejection, not a deploy outcome worth reporting).
@stekern
stekern requested a review from a team as a code owner May 5, 2026 12:31

@yngvark yngvark left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

if: ${{ always() && inputs.send-deployment-metric == 'true' && inputs.datadog-api-key != '' }}
# Skip when a manual deploy was rejected by policy (e.g., `xx-` artifact to prod):
# that's an expected refusal, not a deploy outcome we want in the metric.
if: ${{ always() && steps.block-unsafe-deployment.outputs.result != 'true' && inputs.send-deployment-metric == 'true' && inputs.datadog-api-key != '' }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Måtte scrolle opp litt for å forstå steps.block-unsafe-deployment.outputs.result != 'true'.

steps.block-unsafe-deployment.outputs.result != 'true'

kunne vært noe sånt som

steps.block-unsafe-deployment.outputs.blocked != 'true'

eller

steps.block-unsafe-deployment.outputs.blocked == 'false'

for lettere lesbarhet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants